import request from '../utils/request'

export default {
    get(id) {
        return request.get('/sysUser/get', { id })
    },
    page({ current, size, query }) {
        return request.get('/sysUser/pageData',
            {
                current,
                size,
                ...query
            })
    },
    addUser(data) {
        return request.post('/sysUser/save', data)
    },
    roleList(id) {
        return request.get('/sysUser/roleList', {id})
    },
    accountInfo(id) {
        return request.get('/sysUser/accountInfo', {id})
    },
    activateUser(data) {
        return request.post('/sysUser/activateUser', data)
    },
    updateUser(data) {
        return request.post('/sysUser/update', data)
    },
    updateUserRole(userId, data) {
        return request.post(`/sysUser/updateUserRole?userId=${userId}`, data)
    },
    deleteUser(id) {
        return request.get('/sysUser/delete', { id })
    },
    deleteUserBatch(data) {
        return request.post('/sysUser/deleteBatch', data)
    },
    enableUser(id) {
        return request.get('/sysUser/enableUser', { id })
    },
    disableUser(id) {
        return request.get('/sysUser/disableUser', { id })
    },
    resetPassword(id, password) {
        return request.post(`/sysUser/resetPassword?userId=${id}&password=${password}`, {})
    },
}